#include "RayTracing.h"


RayTracing::RayTracing()
{

}
RayTracing::RayTracing(scene *_World, camera *_Cam, renderoptions *_Properties)
{
	World		= _World;
	Camera		= _Cam;
	Properties	= _Properties;
}
RayTracing::~RayTracing()
{

}
void RayTracing::render(std::string picName)
{
	srand((unsigned int)time(NULL));
	World->setRenderoptions(Properties);
	if(Properties->getPhotonMapping())
		World->createPhotonMap();

	Camera->setRenderoptions(Properties);

	picture Picture(Properties->getWidth(),Properties->getHeight());

	Camera->render(World, &Picture, picName);
}
